package easy;

public class SumOfSquareNumbers {
    //Brute Force
    public static boolean judgeSquareSum0(int c) {
        for(int i=0;i<=c;i++){
            for(int j=0;j<=c;j++){
                if((i*i+j*j)==c){
                    return true;
                }
            }
        }
        return false;
    }
    //Brute Force
    public static boolean judgeSquareSum1(int c){
        for(long i=0;i*i<=c;i++){
            double b = Math.sqrt(c-i*i);
            if(b==(int)b){
                return true;
            }
        }
        return false;
    }
//    public static  void  main(String[]  args)  {
//        int square = 999999999;
//        System.out.println(judgeSquareSum1(square));
//    }
}
